﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DHQGHN.DAL.Common
{
    public class Utils
    {
        public static string CatString(string[] list, string spliter = ",")
        {
            int len = list.Length;
            StringBuilder builder = new StringBuilder(len);
            for (int i = 0; i < len; i++)
            {
                builder.Append(list[i]).Append(spliter);
            }
            string result = builder.ToString().TrimEnd(',');

            return result;
        }

        public static string CatString(List<string> list, string spliter = ",")
        {
            string result = CatString(list.ToArray(), spliter);

            return result;
        }
    }
}
